import request from '../utils/request'

// 获取已购买的商品列表
export const getPurchasedItemsService = () => {
  return request.get('/purchaseditems/list')
}

// 获取所有待支付或已失效订单
export const getAllPendingOrExpiredOrdersService = () => {
  return request.get('/itemOrder/getAllPendingOrExpiredItemOrder')
}

// 根据订单编号查询订单详情
export const getOrderDetailService = (orderNo: string) => {
  return request.get('/itemOrder/getItemDetail', {
    params: { orderNo }
  })
}

// 确认收货
export const confirmReceiptService = (Id: number) => {
  return request.post('/purchaseditems/confirm', null, {
    params: { Id }
  })
}

// 申请退款
export const applyRefundService = (Id: number) => {
  return request.post('/purchaseditems/refund', null, {
    params: { Id }
  })
}
